import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { TableOptions } from "quote";
import { Router } from '@angular/router'

@Component({
  // moduleId: module.id,
  selector: 'brief-list',
  templateUrl: 'brief-list.component.html',
  encapsulation: ViewEncapsulation.None,
  styleUrls: [
    'brief-list.component.less'
  ],
  inputs: [
    "briefList"
  ]
})
export class BriefListComponent implements OnInit {

  tableOptions: TableOptions = {
    responsive: {
      enabled: false
    },
    updateByTime: true,
    selectedHighLight: true,
    parts: {
      emptyRow: false,
      header: false,
      pagination: false,
      sort: false
    }
  }

  constructor(
    private goRouter: Router
  ) { }

  ngOnInit() {

  }

  goCheckDetail(quote) {
    // console.debug("Quote Db Click: ", quote);
    this.goRouter.navigate([`/stock/${quote.symbol.replace(/\./, "_")}`]);
  }

  trackBy(brief) {
    return brief.name;
  }

}